# A valid snippet should starts with:
#
#		snippet trigger_word [ "description" [ options ] ]
#
# and end with:
#
#		endsnippet
#
# Snippet options:
#
#		b - Beginning of line.
#		i - In-word expansion.
#		w - Word boundary.
#		r - Regular expression
#		e - Custom context snippet
#		A - Snippet will be triggered automatically, when condition matches.
#
# Basic example:
#
#		snippet emitter "emitter properties" b
#		private readonly ${1} = new Emitter<$2>()
#		public readonly ${1/^_(.*)/$1/}: Event<$2> = this.$1.event
#		endsnippet
#
# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt


snippet statediagram "state diagram demo" b
@startuml
hide empty description

state idle #pink
state s1 : print hello world
state s2
state c1 <<choice>>

state subState {
    state subS1 : print hello world
    state subS2 
    
    [*] -->subS1 
    subS1 --> subS2 
    subS2 --> [*]
}

[*] -down-> idle
idle --> s1 : State jump condition
s1 --> c1 

c1 -[#black,dashed]-> s2 : a > b
c1 --> subState

s2 --> idle
subState --> idle

@enduml
endsnippet

snippet mindmap "mindmap demo" b
@startmindmap
+[#Orange] Colors

++[#lightgreen] Green

++[#FFBBCC] Rose

--[#lightblue] Blue
@endmindmap
endsnippet

snippet sequencediagram "sequence diagram demo" b
@startuml

== Initialization ==

Alice -> Bob: : Can you solve?
Bob --> Alice:  Yes

activate Alice #FFBBBB
Alice -> Bob: Another dialogue
deactivate Alice

Alice <-- Bob: Another dialogue

@enduml
endsnippet

snippet flowdiagram "flow diagram demo" b
@startuml

start

:new page;
if (Page.onSecurityCheck) then (true)
  :Page.onInit();
  if (isForward?) then (no)
    if (continue processing?) then (no)
      stop
    endif

    if (isPost?) then (yes)
      :Page.onPost();
    else (no)
      :Page.onGet();
    endif
    :Page.onRender();
  endif
else (false)
endif

stop
@enduml
endsnippet
